home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / sep91.zip / 9N09104A < prev    next >
Text File  |  1991-07-10  |  737b  |  21 lines

  1.  
  2.     long *datapointer;
  3.     int ticks, stopcount;
  4.     ...
  5.      datapointer=(long *) malloc(stopcount*sizeof(long));
  6.      ticks=0;
  7.      while (ticks <=stopcount) 
  8.           {                        /*ERROR: Put last data
  9.                                    item off the end of the 
  10.                                    malloc'd array while 
  11.                                    processing a predefined
  12.                                    amount of incoming data
  13.                                    from a comm channel. */
  14.           if(dataready)
  15.                {                   /* wait for data-ready signal */
  16.                *(datapointer + ticks) = process_data();
  17.                ticks++;
  18.                } 
  19.           }
  20.  
  21.